﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XQ.WeChatOfficialAccount.DAL.Model.Sys;

namespace XQ.WeChatOfficialAccount.DAL.DAL
{
   public class InputDal
    {

        /// <summary>
        /// 获取下拉
        /// </summary>
        /// <returns></returns>
        public List<AutoInput> SetDate(string keywords)
        {
            List<AutoInput> list= new List<AutoInput>();
            if (!string.IsNullOrEmpty(keywords))
            {
                using (WeChatOfficialAccountEntities ce = new WeChatOfficialAccountEntities())
                {
                    string sql = "select id as EnterpriseID,CompanyName,lat,lng,Address from Enterprise_DetailInfo where CompanyName like '%" + keywords + "%' and rentid is null ";
                    list = ce.Database.SqlQuery<AutoInput>(sql.ToString()).ToList();

                }
            }
            return list;
        }
    }
}
